<template>
  <view>
    <button open-type="share" v-if="iconType == 'wx'">
      <view class="icon-con">
        <image src="@/static/common/wx-share.svg" mode="widthFix" style="width: 160rpx"></image>
      </view>
    </button>
    <view class="icon-con" v-else @click.stop="handleMore">
      <image src="@/static/common/more.svg" mode="scaleToFill"></image>
    </view>
  </view>

</template>

<script setup>
// 引入api
import useStore from "@/store";
const { common, person } = useStore();

const props = defineProps({
  info: {
    type: Object,
    default: () => ({}),
  },
  ids: {
    type: Object,
    default: () => ({}),
  },
  items: {
    type: [Array, String],
    default: () => [1, 2],
  },
  iconType: {
    // wx：微信图标
    type: String,
    default: "",
  },
});
// 卡片右上角操作
const handleMore = () => {
  person.updatePersonId(props.ids);
  common.updateShareParams(props.items);
  common.updatePopupOpen(true, "share");
};
</script>

<style lang=scss scoped>
@import "@/styles/global.scss";
.icon-con {
  padding: 24rpx;
  margin: -24rpx;
}
image {
  width: 80rpx;
  height: 40rpx;
}
</style>